<?php
/**
 * Created by PhpStorm.
 * User: 小蛮哼哼哼
 * Email: 243194993@qq.com
 * Date: 2022/2/10
 * Time: 14:27
 * motto: 现在的努力是为了小时候吹过的牛逼！
 */

declare(strict_types=1);

namespace app\common\business;

use app\common\model\mysql\SeatDialog as ModelObj;
use app\common\validate\SeatDialog as ValObj;
use think\Exception;

class SeatDialog extends Base
{
    /**
     * @var ValObj
     */
    protected ValObj $valObj;
    /**
     * @var ModelObj
     */
    protected ModelObj $modelObj;

    /**
     *
     */
    public function __construct()
    {
        $this->valObj = new ValObj();
        $this->modelObj = new ModelObj();
    }

    /**
     * @param int $type
     * @param string $field
     * @return array
     * @throws Exception
     */
    public function getSeatDialogByTypeList(int $type = 0,string $field="*"){
        try {
            $type = $this->modelObj
                ->field($field)
                ->where('type', $type)
                ->where('type', $type)
                ->select()
                ->toArray();
        }catch (\Exception $e){
            throw new Exception("座位错误");
        }
        return $type;
    }
}
